<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>
	<body>
		<table border="1" cellspacing="0" cellpadding="0">
			<tr>
				<th>Header</th>
				<th>Header</th>
			</tr>
			<tr>
				<td>Data</td>
				<td class="edit">Data</td>
			</tr>
			<tr>
				<td>Data</td>
				<td class="edit">Data</td>
			</tr>
		</table>
		<button class="btn">修改</button>
		<script src="http://cdn.static.runoob.com/libs/jquery/1.10.2/jquery.min.js"></script>
		<script>
			/*
			 * 思路：当点击修改的是时候 ，td变成input
			 * */
			$(".btn").click(function(){
				var btntext=$(this).html();
				if(btntext=="修改"){
					var content=$(".edit").html();
					$(".edit").each(function(){
						$(this).html("<input type='text' value="+content+">");
					})
					
				}else{
					
				}
			
			})
			
			
			
			
			
		</script>
	</body>
</html>
